#include "StdAfx.h"
#include "randomseed.h"

randomseed::randomseed()
{
	reset();
}

randomseed* randomseed::Instance()
{
	if(_p_this == NULL)
	{
		_p_this = new randomseed();
	}
	return _p_this;
}

void randomseed::reset()
{
	srand(time(NULL));
	for(int i = 0; i < 100 ; ++i)
	{
		randomtable[i] = rand() % 1000;
	}
}

DWORD randomseed::getrandAsUINT(DWORD seed)
{
	seed = seed% 100;
	return randomtable[seed];
}

float randomseed::getrandAsFLOAT(DWORD seed)
{
	seed = seed%100;
	return randomtable[seed] / 1000.0f;
}